package asteroids.model.programs.parsing.expressions;


public abstract class CalculationExpression extends BinaryExpression {

	public CalculationExpression(E e1, E e2){
		super(e1,e2);
		if(!canHaveAsCalculationExpression(e2)){
			setExpression(null, null);
		}
		if(!canHaveAsCalculationExpression(e1)){
			setExpression(null, null);
		}
	}
	
	private boolean canHaveAsCalculationExpression(E expression){
		return expression.isDouble() || expression.isString();
	}
	public boolean isDouble(){
		return true;
	}
	public boolean isBoolean(){
		return false;
	}
	public boolean isEntity(){
		return false;
	}
	public boolean isString(){
		return false;
	}
}
